Skip to content

Report live WSGI server in /version to confirm Gunicorn (#1034)#1386

Merged
jonfroehlich merged 1 commit into
masterfrom
1034-version-server-field
Jun 23, 2026
Merged

Report live WSGI server in /version to confirm Gunicorn (#1034)#1386
jonfroehlich merged 1 commit into
masterfrom
1034-version-server-field

Conversation

@jonfroehlich

Copy link
Copy Markdown
Member

Follow-up to #1385 (Gunicorn swap, #1034).

Adds a server field to the /version JSON, read from the live request's SERVER_SOFTWARE, so a deploy can be confirmed to actually be running Gunicorn rather than inferred from the git SHA.

This commit was pushed to the 1034-gunicorn branch just after #1385 merged, so it never made it into that PR — hence this small follow-up.

What you'll see after deploy

GET /version/
{
  "version": "2.20.0",
  "environment": "TEST",
  "git_sha": "9fc6755",
  "built_at": "...",
  "server": "gunicorn/23.0.0"      ← ground truth; "WSGIServer/0.2 CPython/3.13.1" would mean runserver
}

Changes

  • website/views/version.py: add "server": request.META.get("SERVER_SOFTWARE", "unknown") (+ docstring).
  • website/tests/test_version_endpoint.py: pin the field's presence and that it reflects SERVER_SOFTWARE. Full /version suite (7 tests) passes in the container.

Note: locally /version shows WSGIServer/... by design — local dev keeps runserver; Gunicorn only runs when DJANGO_ENV is TEST/PROD.

🤖 Generated with Claude Code

Add a "server" field to the /version payload, read from the live request's
SERVER_SOFTWARE ("gunicorn/<ver>" under #1034 vs. Django's
"WSGIServer/<ver> CPython/<ver>"). The git_sha already tells us which code
deployed, but this is ground truth that the running process is actually
Gunicorn -- not an inference. Adds a regression test pinning the field.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jonfroehlich jonfroehlich merged commit c32df82 into master Jun 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant